package com.example.maax.vo;

import com.example.maax.entity.Task;
import lombok.Data;

@Data
public class TaskReqVO {

    private Long userId;
    private Long deviceId;
    private String type;
    private String params;
    private String payload;
    private Integer status;

    public static Task convert(TaskReqVO item) {
        if (item == null) {
            return null;
        }
        Task result = new Task();
        result.setUserId(item.getUserId());
        result.setDeviceId(item.getDeviceId());
        result.setType(item.getType());
        result.setParams(item.getParams());
        result.setPayload(item.getPayload());
        result.setStatus(item.getStatus());
        return result;
    }
}
